自定义表单设计器演示版源码private Dictionary<string, ModelDesign> _modelHandlers = null; //所有模板列表
private ModelDesign _curModelDesign = null; //当前显示模板
private void Form_ModelDesign_Load(object sender, EventArgs e)
{
try
{
_modelHandlers = new Dictionary<string, ModelDesign>();
InitForm();
//设置控件树点击事件
this.ctl_ControlTree1.NodeMouseClickEvent =new ctl_ControlTree.ClickHandler(ctl_ControlTree1_NodeMouseClickEvent);
//设置选项卡事件
this.ctl_TabMenu1.TabChangedEvent = new ctl_TabMenu.ClickHandler(ctl_TabMenu1_TabChangedEvent);
SingleList.Instance.MessageEvent = new SingleList.messageHandler(Instance_MessageEvent);
////设置模板列表显示
this.ctl_ModelTree1.Parent = this.splitContainer1.Panel2;
this.ctl_ModelTree1.BringToFront();
this.ctl_ModelTree1.Visible = false;
if (_curModelDesign == null) return;
//设置属性编辑器
this.ctl_PropertyGrid1.DesignEvent = new ctl_PropertyGrid.DesignHandler(ctl_PropertyGrid1_DesignEvent);
this.ctl_PropertyGrid1.Parent = this.splitContainer1.Panel2;
this.ctl_PropertyGrid1.BringToFront();
this.ctl_PropertyGrid1.Visible = false;
}
catch (Exception ex)
{
TryCustomException.TransactException(ex);
}
}
评论